$(document).on('hidden', function () {
    $("#loginresult").val("formClosed");
});

$(document).ready(function () {

    var loginResult = $("#loginresult").val();
    var registrationResult = $("#registrationresult").val();

//    alert(loginResult + " " + registrationResult);

    if (loginResult == 'failedLogin' || loginResult == 'loginInitiated' ||
        registrationResult == 'registrationFailed' || registrationResult == 'initiatedRegistration') {
        $('#loginModal').modal('show');
    };
});

